import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
   
    car:[],
    name:"123",
  },
  mutations: {
   
    addshop(state,goods){
      state.car = goods
  

    },

  


  },
  actions: {
  },
  modules: {
  },
  getters:{
    getCount(state){
      var x = 0;
      state.car.forEach(i=>{
        x += parseInt(i.count);
      });
      return x;
    }
  }
})
